﻿namespace HeroldIT.Dnn.Modules.News.SqlProvider
{
    public static partial class TranslateNewsEntry
    {
        static partial void ToBusiness(this NewsEntry from, News.NewsEntry to)
        {
            foreach (NewsEntryDetail detail in from.NewsEntryDetails)
            {
                to.Details.Add(detail.ToBusiness());
            }
        }

        static partial void ToLinq(this News.NewsEntry from, NewsEntry to)
        {
            foreach (News.NewsEntryDetail detail in from.Details)
            {
                if (!detail.IsEmpty())
                {
                    to.NewsEntryDetails.Add(detail.ToLinq());
                }
            }
        }
    }
}
